package com.yami.shop.nftaccount.common.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yami.shop.nftaccount.common.model.NftAssetTrends;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface NftAssetTrendsMapper extends BaseMapper<NftAssetTrends> {

    @Select("SELECT a.* FROM tz_nft_asset_trends a WHERE a.`status` = 0 " +
            "and NOT EXISTS (SELECT 1 FROM tz_nft_asset_trends b WHERE b.token_id = a.token_id and b.`status` in (2,3)) " +
            "ORDER BY a.create_time ASC, a.id ASC limit #{size} ")
    List<NftAssetTrends> getTrendsExcludeException(@Param("size") int size);
    
}
